package com.atguigu.test.event;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.context.ApplicationListener;

/**
 * @author zp
 * @version 1.0
 * @description: 事件处理类
 * @date 2023/2/16 20:03
 */
@Slf4j
public class MyEventService {
    @Autowired
    private ApplicationEventPublisher publisher;
    public void doEvent(){
        log.info("[调用注册]");
        publisher.publishEvent(new MyEvent("MyEventService.doEvent调用"));
    }
}
